#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: season
# @File  : views.py
# @Date  : 2018/8/31
# @Desc  : 识图

from django.shortcuts import render, HttpResponse

# Create your views here.


# .表示当前包下的models

from .models import StudentModel
from django.views.generic import View


class Student(View):
    def post(self, request):
        StudentModel.objects.create(name='水痕', age=20)
        return HttpResponse('hello word')

    def get(self, request):
        result = StudentModel.objects.filter(age='20')
        result = result[0]
        print(result)
        return HttpResponse(result.name)
